#include <iostream>
#define N 100

using namespace std;

void descent_sort(int array[],int elements){
int i, j;
int temp;
for(i = 1;i<elements;i++){
    for (j=0;j<elements-1;j++){
        if(array[j+1]>array[j]){
                    temp = array[j];
                    array[j] = array[j+1];
                    array[j+1] = temp;}
        }
    }
}

void readintVector(int array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"a["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}

void printVector(int array[], int elements){
int i;
for (i=0; i<elements; i++){
    cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int array[N];
int elements;

cout<<"Type the number of elements you want in the array: ";
cin>>elements;
readintVector(array,elements);

cout<<"The original array is ";
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
cout<<endl;

descent_sort(array, elements);
cout<<"The descendent ordered array is: "<<endl;
printVector(array, elements);


return 0;
}
